|
SET OBJECT TRANSPARENCY
This command will set the transparency state of the specified object.
SET OBJECT TRANSPARENCY Object Number, Flag
Object Number
Integer
The object number
Flag
Integer
The transparency mode number
This command does not return a value.
The transparent colour is determined by the SET IMAGE COLORKEY command or the alpha channel of the texture. The transparency modes are used to control when and how the object is drawn into the scene, and are described below. Special consideration should be used with the depth sort system, which takes the coordinate of the object and camera and depth sorts based on the distance between these points. You can inadvertantly create a situation where a large object behind a small object would have a shorter distance, and be rendered last instead of first.
0 - draw first no alpha 1 - draw first with alpha masking 2 and 3 - draw second which overlaps solid geometry 4 - draw second alpha test (only render beyond 0x000000CF alpha values) 5 - water line object (seperates depth sort automatically) 6 - combination of 3 and 4 (second phase render with alpha blend AND alpha test, used for fading LOD leaves)
sync on : sync rate 60 : hide mouse:cls 0:color backdrop 0
fog on:fog color 0:set ambient light 50
ObjectNumber=2:ImageNumber=2
wire=0:trans=0:cull=0:fliter=0:light=0:fog=0:ambient=0
set global object creation 0
set dir "models"
load object "ast4.x",ObjectNumber
set object specular ObjectNumber,0
rotate object ObjectNumber,270,0,0
set dir ".."
while mouseclick()<>2
set cursor 0,0
print "press 1 to set object wireframe";wire:if inkey$()="1" then wire=1-wire:set object wireframe ObjectNumber,wire
print "press 2 to set object transparency";trans:if inkey$()="2" then trans=1-trans:set object transparency ObjectNumber,trans
print "press 3 to set object cull";cull:if inkey$()="3" then cull=1-cull:set object cull ObjectNumber,cull
print "press 4 to set object filter";filter:if inkey$()="4" then filter=1-filter:set object filter ObjectNumber,filter
print "press 5 to set object light";light:if inkey$()="5" then light=1-light:set object light ObjectNumber,light
print "press 6 to set object fog";fog:if inkey$()="6" then fog=1-fog:set object fog ObjectNumber,fog
print "press 7 to set object ambient";ambient:if inkey$()="7" then ambient=1-ambient:set object ambient ObjectNumber,ambient
while scancode()<>0:endwhile
if mouseclick()=1 then yrotate object ObjectNumber,wrapvalue(object angle y(ObjectNumber)+1)
sync
endwhile
while mouseclick()=1:endwhile
delete object ObjectNumber
end
BASIC3D Commands Menu
Index
|